﻿using Ardalis.Specification;
using HuaweiCloud.Dotnet.Samples.ESports.Main.Entities;

namespace HuaweiCloud.Dotnet.Samples.ESports.Main.Specification
{
    public sealed class BindInfoSpecification : Specification<BindInfo>
    {
       
        public BindInfoSpecification()
        {
            
        }

        /// <summary>
        /// 通过用户id 查询绑定信息
        /// </summary>
        /// <param name="userId">用户id</param>
        public BindInfoSpecification GetByUserId(Guid userId)
        {
            Query.Where(x => x.UserId == userId);
            return this;
        }

        /// <summary>
        /// 通过穿戴设备id 查询绑定信息
        /// </summary>
        /// <param name="deviceId">穿戴设备id</param>
        public BindInfoSpecification(Guid deviceId)
        {
            Query.Where(x => x.DeviceId == deviceId);
        }
    }
}
